package org.btik;

import org.btik.context.AppContext;
import org.btik.context.handler.LifecycleController;
import org.btik.context.handler.ShutdownHandler;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplicationShutdownHandlers;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;

/**
 * @author lustre
 * @version 1.0
 * @since 2021/5/15 12:37
 * Light APP
 */
@SpringBootApplication
@ImportResource("classpath:/light-app.xml")
@ServletComponentScan
public class LightServerApplication {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(LightServerApplication.class, args);
        LifecycleController lifecycleController = context.getBean(LifecycleController.class);
        lifecycleController.doAppStart(context.getBean(AppContext.class));
    }


}
